import { cloud, default as request } from "@/framework/utils/request";

/**
 * @description: 查询活动列表 /tMacActiveSetting/page
 * @param data
 */
export function QueryActiveList(data) {
  return request({
    url: `${cloud.mall}/tMacActiveSetting/page`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 新建活动 /tMacActiveSetting/add
 * @data
 */
export function AddActiveFun(data) {
  return request({
    url: `${cloud.mall}/tMacActiveSetting/add`,
    method: "post",
    data,
  });
}

/**
 * @description: 活动编辑 /tMacActiveSetting/edit
 * @data
 */
export function EditActiveFun(data) {
  return request({
    url: `${cloud.mall}/tMacActiveSetting/edit`,
    method: "post",
    data,
  });
}

/**
 * @description: 活动状态开关 /tMacActiveSetting/switch
 * @data
 */
export function EditSwitchFun(data) {
  return request({
    url: `${cloud.mall}/tMacActiveSetting/switch`,
    method: "post",
    data,
  });
}

/**
 * @description: 活动查看 /tMacActiveSetting/detail
 * @param data
 */
export function WatchActiveInfo(data) {
  return request({
    url: `${cloud.mall}/tMacActiveSetting/detail`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 活动商品列表 /tMacActiveGoodsDetails/page
 * @param data
 */
export function GetGoodsList(data) {
  return request({
    url: `${cloud.mall}/tMacActiveGoodsDetails/page`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 申请列表-审核 /tMacActiveGoodsDetails/goods/review
 * @data
 */
export function batchUpdateApply(data) {
  return request({
    url: `${cloud.mall}/tMacActiveGoodsDetails/goods/review`,
    method: "post",
    data,
  });
}

/**
 * @description: 查看店铺详情 /tMallInfo/getMallInfoByMallCode
 * @param data
 */
export function QueryStoreInfo(data) {
  return request({
    url: `${cloud.mall}/tMallInfo/getMallInfoByMallCode`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 活动取消 /tMacActiveSetting/cancel
 * @data
 */
export function CancelActivity(data) {
  return request({
    url: `${cloud.mall}/tMacActiveSetting/cancel`,
    method: "post",
    data,
  });
}

/**
 * @description: 统计信息列表 /tMacActivityGoodsRecord/page
 * @param data
 */
export function StatisticInfo(data) {
  return request({
    url: `${cloud.mall}/tMacActivityGoodsRecord/page`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 参加活动-商品列表 /tMacActiveGoodsDetails/goods/list
 * @param data
 */
export function ParticipateInList(data) {
  return request({
    url: `${cloud.mall}/tMacActiveGoodsDetails/goods/list`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 参加活动提交 /tMacActiveGoodsDetails/goods/submit
 * @data
 */
export function SubmitActiveGoods(data) {
  return request({
    url: `${cloud.mall}/tMacActiveGoodsDetails/goods/submit`,
    method: "post",
    data,
  });
}

/**
 * @description: 参加活动提交 /tMacActiveGoodsDetails/goods/submit
 * @data
 */
export function SubmitActiveGoodsTwo(data) {
  return request({
    url: `${cloud.mall}/tMacActiveGoodsDetails/goods/submit?activityCategory=2`,
    method: "post",
    data,
  });
}

/**
 * @description: 参加商品列表 /tMacActiveGoodsDetails/page
 * @param data
 */
export function ActiveGoods(data) {
  return request({
    url: `${cloud.mall}/tMacActiveGoodsDetails/page`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 活动页面 /tMacActiveSetting/details
 * @param data
 */
export function GoActivePage(data) {
  return request({
    url: `${cloud.mall}/tMacActiveSetting/details`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 参加活动-规格信息 /goods/getSpecItemAttr
 * @param data
 */
export function GoodsSpecifications(data) {
  return request({
    url: `${cloud.mall}/goods/getSpecItemAttr`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 秒杀活动-活动商品 /flashSale/page
 * @param data
 */
export function FlashActiveGoods(data) {
  return request({
    url: `${cloud.mall}/flashSale/page`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 订单提交 /tModOrder/flashSale/insert
 * @data
 */
export function SubmitGetInsert(data) {
  return request({
    url: `${cloud.mall}/tModOrder/flashSale/insert`,
    method: "post",
    data,
  });
}